package com.zhhtech.zhh.ui.activity.commom

import com.zhhtech.zhh.R
import com.zhhtech.zhh.databinding.ActivityGuideBinding
import com.zhhtech.zhh.ui.adapter.SyBannerImageAdapter
import com.zhhtech.zhh.ui.base.BaseActivity

class GuideActivity : BaseActivity<ActivityGuideBinding>() {
    override fun initView() {
        // R.mipmap.image_guide_1, R.mipmap.image_guide_2,
        val datas = mutableListOf(R.mipmap.image_guide_3)
        vb.banner.setAdapter(SyBannerImageAdapter(datas) { it }, false)
//        vb.banner.indicator = CircleIndicator(mThis)
        vb.banner.isAutoLoop(false)
        vb.banner.addBannerLifecycleObserver(this)
        vb.banner.setOnBannerListener { _, position ->
            if (datas.size - 1 == position) {
                finish()
            }
        }
    }

    override fun onBackPressed() {
        setResult(RESULT_OK)
        super.onBackPressed()
    }
}